Command Shell

It is sometimes necessary to execute external commands in windows command shell from TSQL. The xp_cmdshell extended stored procedure allows you to do just that. Because this command shell can be a potential target for hackers, it is turned off by default. Today, I am going to use this command to solve a real world ETL problem. The following SQL snippet uses the sp_configure command to enable this option. [crayon-664a21ed97d46159325088/] The xp_cmdshell command takes a valid DOS string as input and executes asynchronously in a windows command shell until the … Continue reading Command Shell